
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../../assets/color_config.dart';
import '../../../common/common_config.dart';

class TabModel {
  static double tabHeight = Get.bottomBarHeight;
  int currentIndex = 0;
  List barItemList = [
    {
      "title": "tab_main".tr,
      "selectIcon": '${assetImage}tab/tab_home_select.png',
      "normalIcon": '${assetImage}tab/tab_home.png',
    },
    {
      "title": "tab_orders".tr,
      "selectIcon": '${assetImage}tab/tab_order_select.png',
      "normalIcon": '${assetImage}tab/tab_order.png',
    },
    {
      "title": "tab_mine".tr,
      "selectIcon": '${assetImage}tab/tab_mine_select.png',
      "normalIcon": '${assetImage}tab/tab_mine.png',
    },
  ];
  //Page视图
  PageController tabPageController = PageController();

  //当前显示的颜色
  Color presentColor(int index) {
       return currentIndex == index ? ColorConfig.colorPrimary : Colors.grey;
  }

  // 选中下标的切换
  changeBottomTabIndex(int index) {
    currentIndex = index;
    tabPageController.jumpToPage(index);
  }
}